package com.dingwen.treasure.base.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 　RuleEnum
 * 　@author dingwen
 * 　@date 2022/6/14
 */
@Getter
@AllArgsConstructor
public enum RuleEnum implements BaseEnum<Integer> {
    /**
     * 必填
     */
    REQUIRED(0, "必填"),

    /**
     *长度
     */
    LEN(1, "长度"),

    /**
     * 必填+长度
     */
    REQUIRED_AND_LEN(2, "必填+长度"),

    /**
     * 敏感词
     */
    SENSITIVE(3, "敏感词"),

    /**
     * 正则
     */
    REGULAR_PATTERN(4, "正则");

    /**
     * 状态值
     */
    @EnumValue
    private final Integer code;

    /**
     * 状态描述
     */
    private final String description;

    /**
     * 获取枚举类描述
     *
     * @return {@link String}
     */
    @Override
    public String getEnumDescription() {
        return "规则";
    }

}
